//
//  RBHistoryCell.m
//  zhongzhenglu
//
//  Created by XL on 2022/7/15.
//

#import "RBHistoryCell.h"
#import "UIView+RBAdd.h"
#import <UIColor+YYAdd.h>
#import "RBDefine.h"
#import "RanTool.h"
#import "UIImageView+RBAdd.h"

@interface RBHistoryCell()

@property(nonatomic, strong)IBOutlet UIImageView *imgView;
@property(nonatomic, strong)IBOutlet UILabel *nameL;
@property(nonatomic, strong)IBOutlet UILabel *priceL;

@property(nonatomic, strong) RBCellModel *cellModel;

@end

@implementation RBHistoryCell

- (void)awakeFromNib
{
    [super awakeFromNib];
    [self zoomSubViewsWithSelf];
}

- (void)setCellModel:(RBCellModel *)cellModel
{
    _cellModel = cellModel;
    RBHistoryModel *model = cellModel.cellData;
    [self.imgView setImageWithUrl:model.picurl placeHolder:nil];
    self.nameL.text = model.good_name;
    self.priceL.attributedText = [RanTool attributeStringMaker:^(NSMutableArray *maker) {
        [maker addAttributeStringWithFont:[UIFont systemFontOfSize:Zoom(11)] color:[UIColor colorWithHexString:@"#F23030"] string:@"￥"];
        [maker addAttributeStringWithFont:[UIFont systemFontOfSize:Zoom(16)] color:[UIColor colorWithHexString:@"#F23030"] string:model.sell_price];
    }];
}

#pragma mark - Event

- (IBAction)addToCartBtnTapped
{
    //exp
}



@end
